package com.example.demo.aop;

import com.example.demo.dto.Result;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@RestControllerAdvice
public class MyExceptionHandler {
    @ExceptionHandler(value = Exception.class)
    public Result<Void> fail(Exception e) {
        return Result.fail(500, e.getMessage());
    }
}
